#include "SensorXYZComponent.h"
#include "SensorXYZViewResourceDefine.h"


void SensorXYZComponent::clearArea()
{
#ifdef DEBUGING
	Serial.println("SensorXYZComponent::clearArea()");
#endif
}

void SensorXYZComponent::doRender()
{
#ifdef DEBUGGING
	Serial.println("SensorXYZComponent::doRender()");
#endif

	Serial.printf("%d,%d,%d\n", x, y, z);

	if (SENSORXYZ_IS_A && (direction != 'A'))
	{
		direction = 'A';
		Serial.println("A");

		lcd.drawBmpFile(SD, SENSORXYZ_PIC_A, SENSORXYZ_START_X, SENSORXYZ_START_Y);
	}
	else if (SENSORXYZ_IS_B && (direction != 'B'))
	{
		direction = 'B';
		Serial.println("B");

		lcd.drawBmpFile(SD, SENSORXYZ_PIC_B, SENSORXYZ_START_X, SENSORXYZ_START_Y);
	}
	else if (SENSORXYZ_IS_C && (direction != 'C'))
	{
		direction = 'C';
		Serial.println("C");

		lcd.drawBmpFile(SD, SENSORXYZ_PIC_C, SENSORXYZ_START_X, SENSORXYZ_START_Y);
	}
	else if (SENSORXYZ_IS_D && (direction != 'D'))
	{
		direction = 'D';
		Serial.println("D");

		lcd.drawBmpFile(SD, SENSORXYZ_PIC_D, SENSORXYZ_START_X, SENSORXYZ_START_Y);
	}
}